/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.xiang.jeesite.common.tree.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.xiang.jeesite.common.tree.entity.CommonTree;
import com.xiang.jeesite.common.tree.dao.CommonTreeDao;

/**
 * 公共分类Service
 * @author xiang
 * @version 2015-11-30
 */
@Service
@Transactional(readOnly = true)
public class CommonTreeService extends TreeService<CommonTreeDao, CommonTree> {

	public CommonTree get(String id) {
		return super.get(id);
	}
	
	public List<CommonTree> findList(CommonTree commonTree) {
		if (StringUtils.isNotBlank(commonTree.getParentIds())){
			commonTree.setParentIds(","+commonTree.getParentIds()+",");
		}
		return super.findList(commonTree);
	}
	
	@Transactional(readOnly = false)
	public void save(CommonTree commonTree) {
		super.save(commonTree);
	}
	
	@Transactional(readOnly = false)
	public void delete(CommonTree commonTree) {
		super.delete(commonTree);
	}
	
}